﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="nearShop.ascx.cs" Inherits="UserControl_nearShop" %>
<%@ Register Src="StaticRate.ascx" TagName="StaticRate" TagPrefix="uc1" %>
<div class="nearshopfm">
    <h4>
        附近热门餐厅</h4>
    <ul class="nearshoplist">
        <% foreach (var shop in NearShops)
           {
        %>
        <li class="nearshoplistinfo">
            <div class="nearshop-name">
                <%=shop.NearShopName %>
            </div>
            <div class="nearshop-share">
                分享数：<%=shop.NearShopShareNum %>
            </div>
            <div class="nearshop-levelstar">
            <% 
               
               UserControl_StaticRate rateControl = this.LoadControl("StaticRate.ascx") as UserControl_StaticRate;
               rateControl.Rate = (int)shop.NearShopDebateScore;
               rateControl.IsLarge = false;

               //将用户控件渲染到输出流中
               //HtmlTextWriter htmlWriter = new HtmlTextWriter(Response.Output);
               //rateControl.RenderControl(htmlWriter);
               //htmlWriter.Flush();
               
               //将用户控件渲染到输出流中
               Response.Write(RenderUserControl(rateControl));
               
            %>
            </div>
            <div class="nearshop-score">
                <%=shop.NearShopDebateScore %>分
            </div>
            <a href="#">评论数<%=shop.NearShopDedateNum %></a> </li>
        <%    }
        %>
    </ul>
</div>
<%--<hr />
<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <div>
            <div class="nearshop-name">
                <%# (Container.DataItem as NearShop).NearShopName %>
            </div>
            <div class="nearshop-share">
                分享数：<%# (Container.DataItem as NearShop).NearShopShareNum%>
            </div>
            <uc1:StaticRate runat="Server" IsLarge="false" Rate="<%# (Container.DataItem as NearShop).NearShopDebateScore %>" />
            <div class="nearshop-score">
                <%# (Container.DataItem as NearShop).NearShopDebateScore %>
            </div>
            <a href="#">评论数
                <%# (Container.DataItem as NearShop).NearShopDedateNum %></a></div>
    </ItemTemplate>
</asp:Repeater>
<hr />
<div id="txtGeneratedHtmlContainer" enableviewstate="false" runat="Server">
</div>--%>
